package com.aaa.gs.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @fileName:MyRule
 * @description:
 * @author:忆尘
 * @createTime:2020/11/4 14:16
 * @version:1.0.0
 */

@Configuration //<beans><beans>
@SuppressWarnings("all")
public class MyRule {
    /**
     * 配置负载均衡策略
     * @return
     */
    @Bean //<bean id='iRule' class="import com.netflix.loadbalancer.IRule" />
    public IRule iRule(){
        //轮询

        int i = 0;
        return new MyRandomRule();
    }
}
